package com.xsmart.goods.api;

import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/api")
public class DemoController {
    @RequestMapping(value = "/v1/demoController/goods", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean goods(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        System.out.println("demo api impl");
        ResponseBean responseBean = requestBean.getResponseBean();
        responseBean.addResultItem("result", "1");
        responseBean.addResultItem("test", "ok");
        responseBean.addResultItem("test", "ok");
        return responseBean;
    }
}
